package org.uoss.webapp.framework.context;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.uoss.applications.framework.configuration.AppSystemConfigurationImpl;
import org.uoss.applications.framework.configuration.IAppSystemConfiguration;

public class WebappSystemConfiguration extends AppSystemConfigurationImpl implements IAppSystemConfiguration {

	public WebappSystemConfiguration(){
		super();
	}
	@Override
	public void loadLocalConfiguration() {
		InputStream is = null;
		try {
			is = this.getClass().getResourceAsStream("/META-INF/Local-Application-Context.properties");
			if(is!=null){
				this.properties = new Properties();
				this.properties.load(is);
			}
		}
		catch (IOException e) {
			e.printStackTrace();
		}
		finally{
			if(is==null||this.properties.isEmpty()){
				this.loadDefaultConfiguration();
			}
		}
	}

}
